/*
   LineDisplayControl.h
   
   Copyright (C) 2006 LinuxOne, Inc. <Republic of korea>

   This library is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   Lessor General Public License for more details.

   You should have received a copy of the GNU Lessor General Public
   License along with this library; if not, write to the Free Software
   Foundation, inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

   Hyunjin Kim <mgc521@linuxone.co.kr>

   LinuxOne, Inc., hereby disclaims all copylight
   written by Hyunjin Kim, 20 December 2006
*/

#ifndef _BOOYO_POS_LINEDISPLAY_CONTROL_H_
#define _BOOYO_POS_LINEDISPLAY_CONTROL_H_

#include <BaseControl.h>
#include <BooyoPOSException.h>
#include <const/LineDisplayConst.h>
#include <services/LineDisplayService.h>

namespace booyopos
{

class CLineDisplay : public CBaseControl, public CLineDisplayConst
{
private:
	services::CLineDisplayService *lds;
public:
	CLineDisplay();
	~CLineDisplay();

	/* Capabilities */
	int GetCapBlink() throw (CByException);
	bool GetCapBrightness() throw (CByException);
	int GetCapCharacterSet() throw (CByException);
	bool GetCapDescriptors() throw (CByException);
	bool GetCapHMarquee() throw (CByException);
	bool GetCapICharWait() throw (CByException);
	bool GetCapVMarquee() throw (CByException);
	int GetCapPowerReporting() throw (CByException);
	bool GetCapBlinkRate() throw (CByException);
	int GetCapCursorType() throw (CByException);
	bool GetCapCustomGlyph() throw (CByException);
	int GetCapReadBack() throw (CByException);
	int GetCapReverse() throw (CByException);
	bool GetCapBitmap() throw (CByException);
	bool GetCapMapCharacterSet() throw (CByException);
	bool GetCapScreenMode() throw (CByException);
	bool GetCapStatisticsReporting() throw (CByException);
	bool GetCapUpdateStatistics() throw (CByException);
	bool GetCapCompareFirmwareVersion() throw (CByException);
	bool GetCapUpdateFirmware() throw (CByException);

	/* Properties */
	int GetCharacterSet() throw (CByException);
	void SetCharacterSet(int characterSet) throw (CByException);
	std::string GetCharacterSetList() throw (CByException);
	int GetColums() throw (CByException);
	int GetCurrentWindow() throw (CByException);
	void SetCurrentWindow(int currentWindow) throw (CByException);
	int GetCursorColumn() throw (CByException);
	void SetCursorColumn(int cursorColumn) throw (CByException);
	int GetCursorRow() throw (CByException);
	void SetCursorRow(int cursorRow) throw (CByException);
	bool GetCursorUpdate() throw (CByException);
	void SetCursorUpdate(bool cursorUpdate) throw (CByException);
	int GetDeviceBrightness() throw (CByException);
	void SetDeviceBrightness(int deviceBrightness) throw (CByException);
	int GetDeviceColumns() throw (CByException);
	int GetDeviceDescriptors() throw (CByException);
	int GetDeviceRows() throw (CByException);
	int GetDeviceWindows() throw (CByException);
	int GetInterCharacterWait() throw (CByException);
	void SetInterCharacterWait(int interCharacterWait) throw (CByException);
	int GetMarqueeFormat() throw (CByException);
	void SetMarqueeFormat(int marqueeFormat) throw (CByException);
	int GetMarqueeRepeatWait() throw (CByException);
	void SetMarqueeRepeatWait(int marqueeRepeatWait) throw (CByException);
	int GetMarqueeType() throw (CByException);
	void SetMarqueeType(int marqueeType) throw (CByException);
	int GetMarqueeUnitWait() throw (CByException);
	void SetMarqueeUnitWait(int marqueeUnitWait) throw (CByException);
	int GetRows() throw (CByException);
	int GetPowerNotify() throw (CByException);
	void SetPowerNotify(int powerNotify) throw (CByException);
	int GetPowerState() throw (CByException);
	int GetBlinkRate() throw (CByException);
	void SetBlinkRate(int blinkRate) throw (CByException);
	int GetCursorType() throw (CByException);
	void SetCursorType(int cursorType) throw (CByException);
	std::string GetCustomGlyphList() throw (CByException);
	int GetGlyphHeight() throw (CByException);
	int GetGlyphWidth() throw (CByException);
	bool GetMapCharacterSet() throw (CByException);
	void SetMapCharacterSet(bool mapCharacterSet) throw (CByException);
	int GetMaximumX() throw (CByException);
	int GetMaximumY() throw (CByException);
	int GetScreenMode() throw (CByException);
	void SetScreenMode(int screenMode) throw (CByException);
	std::string GetScreenModeList() throw (CByException);

	/* Added Methods */
	void Initialize() throw (CByException);

	/* Methods */
	void ClearDescriptors() throw (CByException);
	void ClearText() throw (CByException);
	void DestroyWindow() throw (CByException);
	void DisplayText(std::string data, int attribute) throw (CByException);
	void DisplayTextAt(int row, int column, std::string data, int attribute) throw (CByException);
	void CreateWindow(int viewPortRow, int viewPortColumn, int viewPortHeight, int viewPortWidth,
			int windowHeight, int widowWidth) throw (CByException);
	void RefreshWindow(int window) throw (CByException);
	void ScrollText(int direction, int units) throw (CByException);
	void SetDescriptor(int descriptor, int attribute) throw (CByException);
	void DefineGlyph(int glyphcode, char* glyph) throw (CByException);
	void ReadCharacterAtCursor(int cursorData) throw (CByException);
	void DisplayBitmap(std::string fileName, int width, int alignmentX, int alignmentY) throw (CByException);
	void SetBitmap(int bitmapNumber, std::string fileName, int width, int alignmentX, int alignmentY) throw (CByException);
	
	void ResetStatistics(std::string statisticsBuffer) throw (CByException);
	void RestieveStatistics(std::string statisticsBuffer[]) throw (CByException);
	void UpdateStatistics(std::string statisticsBuffer) throw (CByException);
	void CompareFirmwareVersion(std::string firmwareFileName, int* result) throw (CByException);
	void UpdateFirmware(std::string firmwareFileName) throw (CByException);

	/* Event Handler */
	//sigc::signal<void, int, int, void*>DirectIOEvent_signal() { return DirectIOEvent; }
	//sigc::signal<void, int>StatusUpdateEvent_signal() { return StatusUpdateEvent; }
};

} // namespace booyopos

#endif // _BOOYO_POS_LINEDISPLAY_CONTROL_H_
